<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <form id="submitForm" class="well form-inline margin-top-20" method="post" action="{:url('Wechat/gzhlist')}">
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字...">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger"  href="{:url('Wechat/gzhlist')}" >清空</a>

    </form>

    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <notempty name="category">
                    <th width="50">{:lang('SORT')}</th>
                </notempty>
                <th width="200">公众号名称</th>
                <th width="200">粉丝数量</th>
                <th width="200">登录账号(点击编辑)</th>
                <th width="200">入驻时间</th>
                <th width="200">操作</th>
            </tr>
            </thead>
            <notempty name="list">
                <foreach name="list" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value="{$vo.id}" title="ID:{$vo.id}">
                        </td>
                        <td>
                            <b><notempty name="$vo['imgsrc']">
                                <img src="<?php echo cmf_get_image_url($vo['imgsrc'])?>" style="width: 50px;border: 1px solid;margin: 5px;">
                            </notempty>{$vo.name}</b>
                        </td>
                        <td>{:widget('wechat/fansnum', ['user_id' =>$vo['user_id']])}</td>
                        <td><a href="{:url('user/edit',array('id'=>$vo['user_id']))}">{:widget('wechat/account', ['user_id' =>$vo['user_id']])}</a></td>
                        <td><?php echo date('Y-m-d H:i',$vo['time']);?></td>
                        <td>
                            <a href="javascript:;" onclick="del({$vo.id},'wx_info');">删除</a>
                        </td>
                    </tr>
                </foreach>
            </notempty>
            <tfoot>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <notempty name="category">
                    <th width="50">{:lang('SORT')}</th>
                </notempty>
                <th width="200">公众号名称</th>
                <th width="200">粉丝数量</th>
                <th width="200">登录账号(点击编辑)</th>
                <th width="200">入驻时间</th>
                <th width="200">操作</th>
            </tr>
            </tfoot>
        </table>
        <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<script>
    function del(id,table) {
        layer.confirm('是否删除？删除之后无法恢复', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:"{:url('Wechat/del')}",
                data:{'id':id,'table':table},
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg,{icon: 6,time: 1000},function () {
                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }


</script>
</body>
</html>